
type Easing = "ease-in" | "ease-out" | "ease-in-out";
class UIElement {
    animate(dx: number, dy: number, easing: Easing) {
        if (easing === "ease-in") {
            // ...
        }
        else if (easing === "ease-out") {
        }
        else if (easing === "ease-in-out") {
        }
        else {
            // error! should not pass null or undefined.
        }
    }
}

let button = new UIElement();
button.animate(0, 0, "ease-in");
// button.animate(0, 0, "uneasy"); // error: "uneasy" is not allowed here
function foo(x: number) {
    // if (x !== 1 || x !== 2) {
    //         ~~~~~~~// Operator '!==' cannot be applied to types '1' and '2'.
    // }
}

function pluck<T, K extends keyof T>(o: T, names: K[]): T[K][] {
    return names.map(n => o[n]);
}

interface Person {
    name: string;
    age: number;
}
let person: Person = {
    name: 'Jarid',
    age: 35
};
let strings: string[] = pluck(person, ['name']); // ok, string[]
console.log(strings);
interface IDescription {
    name: string;
    age: number;
    male: boolean;
}

const obj1: IDescription = {
    name: 'jian',
    age: 599,
    male: true,
};
// const tmp25: {} = undefined; // 仅在关闭 strictNullChecks 时成立，下同
// const tmp26: {} = null;
// const tmp27: {} = void 0; // void 0 等价于 undefined

const tmp28: {} = 'jian';
const tmp29: {} = 599;
const tmp30: {} = { name: 'jian' };
const tmp31: {} = () => {};
const tmp32: {} = [];

export { }
